package com.ruoyi.project.bajiaostar.api;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.bajiaostar.cooperationDataManagement.domain.FindDataManagementReq;
import com.ruoyi.project.bajiaostar.cooperationDataManagement.domain.FindDataResp;
import com.ruoyi.project.bajiaostar.cooperationDataManagement.service.ICooperationDataManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 渠道分析管理Controller
 * 
 * @author 谢少辉
 * @date 2025-08-20
 */
@Controller
@RequestMapping("/nt/user/cooperationDataManagement")
@CrossOrigin(origins = "*")
public class WebCooperationDataManagementController extends BaseController
{

    @Autowired
    private ICooperationDataManagementService cooperationDataManagementService;

    /**
     * 查询所有渠道
     */
    @Log(title = "渠道分析管理-查询所有渠道", businessType = BusinessType.OTHER)
    @PostMapping( "/findAddPowderPlan")
    @ResponseBody
    public AjaxResult findAddPowderPlan()
    {
        List<String> plan = cooperationDataManagementService.findAddPowderPlan();
        return AjaxResult.success(plan);
    }


    @Log(title = "渠道分析管理-统计管理", businessType = BusinessType.OTHER)
    @PostMapping( "/findDataManagement")
    @ResponseBody
    public AjaxResult findDataManagement(FindDataManagementReq req)
    {
        FindDataResp dataManagement = cooperationDataManagementService.findDataManagement(req);
        return AjaxResult.success(dataManagement);
    }
}
